﻿using System;
using HttpService.Interface;

namespace HttpApiGateway
{
    public static class LingHelper
    {
        public static Uri GetUri(this IHttpRequest request, string path)
        {
            Uri uri = request.Url;
            if (path[0] == '/')
            {
                return new Uri(string.Format("{0}://{1}{2}", request.Url.Scheme, request.Url.Authority, path));
            }
            return new Uri(string.Format("{0}://{1}/{2}", request.Url.Scheme, request.Url.Authority, path));
        }
    }
}
